package com.bckj.fastboot.iot.api.service;

import com.bckj.fastboot.core.lang.model.PageResult;
import com.bckj.fastboot.iot.common.constant.IotConstants;
import com.bckj.fastboot.iot.common.dto.query.IotDeviceQuery;
import com.bckj.fastboot.iot.common.dto.request.IotDeviceRequest;
import com.bckj.fastboot.iot.common.dto.response.IotDeviceResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * IotDeviceRemoteService
 *
 * @author wfc
 * @date 2025/10/9 15:57
 **/
@FeignClient(value = IotConstants.SERVICE_ID, contextId = "iotDevice", path = "iotDevice")
public interface IotDeviceRemoteService {

    @PostMapping()
    boolean save(@Validated @RequestBody IotDeviceRequest request);

    @PutMapping()
    boolean update(@RequestBody IotDeviceRequest request);

    @GetMapping("/{id}")
    IotDeviceResponse details(@PathVariable Long id);

    @GetMapping("/page")
    PageResult<IotDeviceResponse> page(@SpringQueryMap IotDeviceQuery query);
}
